#include<stdio.h>

int main()
{
	int cost = 1, money = 20, exchange = 2;
	int nums = 0, count = 0;
	while (money)
	{
		money -= cost;
		nums++;
		count++;
		if (count == exchange)
		{
			nums++;
			count = 1;
		}
	}
	printf("nums = %d\n", nums);
	return 0;
}